package API;

import java.util.Arrays;
import java.util.Date;
import java.util.Random;
import java.util.concurrent.ExecutionException;

public class StringIndex {
    public static <Exceptiontype> void main(String[] args) {
        StringBuffer sb=new StringBuffer();
        sb.append("helloworld");
        System.out.println(sb.substring(0,5));//取不到末尾;
        System.out.println(sb);
        int min=1;
        int max=38;
        System.out.println(Math.floor(Math.random()*(max-min))+min);
        Random rad=new Random();
        Date time=new Date();
//        for (int i = 0; i <1000000000 ; i++) {
//            System.out.println("helloworld");
//        }
        System.out.println(Runtime.getRuntime());
        System.out.println(Runtime.version());
        Date time2 =new Date();
        System.out.println(time2.getTime()-time.getTime());//计算算法的时间;

//        System.out.println(rad.nextInt(min,max)+min);//过去的写法
        int number[]=new int[]{9,4,7,3};
        //Arrays工具类
        Arrays.sort(number);
        //异常处理
        try {
            int a=23;
            System.out.println(a);
        }catch(NullPointerException e){
            System.out.println();
        }
    }
}
